<?php

class Ialbum_View_Helper_MorePhotos extends Engine_View_Helper_HtmlImage
{
  
  public function morePhotos($album, $type = 'thumb.normal')
  {
    // Whoops
    if( !($album instanceof Album_Model_Album))
    {
      throw new Zend_View_Exception("Item must be a valid item");
    }
	//get photos of album
	 $paginator = Engine_Api::_()->getDbTable('photos', 'album')->getPhotoPaginator(array(
      'album' => $album,
     ));
     $paginator->setItemCountPerPage(3);
     //get more 2 images
     $content = '';
     $i = 2;
     foreach ($paginator as $photo){
     	if($photo->getIdentity() == $album->photo_id) continue;
     	$content .= '<a style="display: none;" class="thumbs_photo rK uK pic_'.$i.'" href="'.$album->getHref().'">'.
	             '<span style="background-image: url('.$photo->getPhotoUrl($type).');"></span>'.
	             '</a>';
     	$i++;
     }
     return $content;
  }
}